[Isaac Lee] iP#643
Conversation
In build.gradle, the dependencies on distZip and/or distTar causes
the shadowJar task to generate a second JAR file for which the
mainClass.set("seedu.duke.Duke") does not take effect.
Hence, this additional JAR file cannot be run.
For this product, there is no need to generate a second JAR file
to begin with.
Let's remove this dependency from the build.gradle to prevent the
shadowJar task from generating the extra JAR file.
Rename Duke to john chatter, skeletal version that greets user and exits
Add ability to store text entered by user into a list and display them back when requested with the "list" command
Add a "Task" class and the ability to mark a task as done or undone with the "mark" and "unmark" commands.
hwennnn
left a comment
There was a problem hiding this comment.
Overall the code LGTM! The way you're dealing with different kind of tasks is very neat. One suggestion is to add more comments to explain your code. And more refactoring can be done for the main program to improve readability (which would be in the later section)
| return; | ||
| } else if (input.equals("list")) { | ||
| for (int i = 1; i <= items.size(); i++) { | ||
| Task item = items.get(i -1); |
There was a problem hiding this comment.
minor nit: there should be a space after -
| Task item = items.get(i -1); | |
| Task item = items.get(i - 1); |
| if (splitInputAroundSpace.length == 1) { | ||
| throw new JohnChatterException("oops! tasks must have a description"); | ||
| } | ||
| Deadline deadline = new Deadline(input.split("deadline ")[1].split(" /by")[0], input.split("/by ")[1]); |
There was a problem hiding this comment.
To improve the readability of this line of code, you can consider naming the variables and pass that in to the constructor of the deadline
| if (splitInputAroundSpace.length == 2 && splitInputAroundSpace[1].matches("\\d+")) { | ||
| int number = Integer.parseInt(splitInputAroundSpace[1]); | ||
| String task = items.get(number - 1).toString(); | ||
| items.remove(number - 1); |
There was a problem hiding this comment.
It seems like u didn't handle for invalid delete index (i.e the index is out of bound)
|
|
||
| @Override | ||
| public String toString() { | ||
| return "[D]" + super.toString() + " (by: " + by + ")"; |
There was a problem hiding this comment.
perhaps can consider storing the task type [D] on the task class level for more abstraction
|
|
||
| @Override | ||
| public String toString() { | ||
| return "[" + this.getStatusIcon() + "] " + this.description; |
IsaiahToh
left a comment
There was a problem hiding this comment.
Great job. Like the name of the bot.
| public static String parse(String input, Ui ui, Storage storage, TaskList tasks) throws JohnChatterException { | ||
| ArrayList<Task> list = tasks.list; | ||
| String[] splitInputAroundSpace = input.split(" "); | ||
| if (input.equals("bye")) { |
There was a problem hiding this comment.
This definitely works :) Maybe using switch would look cleaner though?
Add javadoc comments to more public classes and methods to comply with the course standard
Add assertions
Branch a code quality
Users may now use the tag and untag commands to manage tags for existing tasks. Users may search for tasks by tag using the findtag command. The existing find command, which searches tasks by name, has also been updated to accept multiple keywords and be case insensitive for consistency with findtag.
John Chatter
John Chatter frees your mind of having to remember things you need to do. It's,
FASTSUPER FAST to useAll you need to do is,
And it is FREE!
Features:
If you are a Java programmer, you can use it to practice Java too. Here's the
mainmethod: